<h1>{{ title }}</h1>

<form action=""
    method="POST"
    id="siteadmin-access-anonymous"
    data-current-access-mode="{{ current_access_mode }}"
    data-nb-restricted-users="{{ nb_restricted_users }}"
    data-ugroup_authenticated_users="{{ ugroup_authenticated_users }}"
    data-ugroup_registered_users="{{ ugroup_registered_users }}"
>
    <input
        type="hidden"
        name="project_admin_can_choose_visibility"
        {{# project_admin_can_choose }}value="1"{{/ project_admin_can_choose }}
        {{^ project_admin_can_choose }}value="0"{{/ project_admin_can_choose }}
    >
    {{# csrf_token }}
        {{> csrf_token_input }}
    {{/ csrf_token }}

    {{# is_localinc_obsolete }}
    <div class="alert alert-error">
        {{{ localinc_obsolete_message }}}
    </div>
    {{/ is_localinc_obsolete }}

    <div class="tlp-pane">
        <div class="tlp-pane-container">
            <div class="tlp-pane-header">
                <h1 class="tlp-pane-title"><i class="fa fa-lock tlp-pane-title-icon"></i> {{ platform_access_control_label }}</h1>
            </div>
            <section class="tlp-pane-section">
                <div class="tlp-form-element">
                    <label class="tlp-label tlp-radio">
                        <input
                            type="radio"
                            name="access_mode"
                            value="anonymous"
                            {{# access_anonymous }}checked{{/ access_anonymous }}
                        > {{ access_anonymous_label }}
                    </label>
                    <p class="tlp-text-info siteadmin-access-option-desc">{{ access_anonymous_desc }}</p>
                </div>
                <div class="tlp-form-element">
                    <label class="tlp-label tlp-radio">
                        <input
                            type="radio"
                            name="access_mode"
                            value="regular"
                            {{# access_regular }}checked{{/ access_regular }}
                        > {{ access_regular_label }}
                    </label>
                    <p class="tlp-text-info siteadmin-access-option-desc">{{ access_regular_desc }}</p>
                </div>
                <div class="tlp-form-element">
                    <label class="tlp-label tlp-radio">
                        <input
                            type="radio"
                            name="access_mode"
                            value="restricted"
                            {{# access_restricted }}checked{{/ access_restricted }}
                        > {{ access_restricted_label }}
                    </label>
                    <p class="tlp-text-info siteadmin-access-option-desc">{{ access_restricted_desc }}</p>

                    <div id="siteadmin-access-customize-ugroup-labels">
                        <p>{{ customize_ugroups_label_info }}</p>
                        <div class="tlp-form-element">
                            <label class="tlp-label" for="siteadmin-authenticated-ugroup-name">
                                {{ ugroup_authenticated_users_label }}
                            </label>
                            <input
                                type="text"
                                class="tlp-input"
                                id="siteadmin-authenticated-ugroup-name"
                                name="ugroup_authenticated_users"
                                value="{{ ugroup_authenticated_users }}"
                                placeholder="{{ ugroup_authenticated_users_placeholder }}"
                                size="30"
                            >
                        </div>
                        <div class="tlp-form-element">
                            <label class="tlp-label" for="siteadmin-restricted-ugroup-name">
                                {{ ugroup_registered_users_label }}
                            </label>
                            <input
                                type="text"
                                class="tlp-input"
                                id="siteadmin-restricted-ugroup-name"
                                name="ugroup_registered_users"
                                value="{{ ugroup_registered_users }}"
                                placeholder="{{ ugroup_registered_users_placeholder }}"
                                size="30"
                            >
                        </div>
                    </div>
                </div>

                <div id="siteadmin-access-submit-panel" class="tlp-pane-section-submit">
                    {{# access_restricted }}
                        {{# nb_restricted_users }}
                            <div id="siteadmin-access-submit-panel-message">
                                {{{ current_restricted_users_message }}}
                            </div>
                        {{/ nb_restricted_users }}
                    {{/ access_restricted }}

                    <button
                        type="submit"
                        class="tlp-button-primary"
                        name="update"
                        value="1"
                        disabled
                    ><i class="fa fa-save tlp-button-icon"></i>
                    {{ btn_submit }}</button>
                </div>
            </section>
        </div>
    </div>
</form>

<form action="" method="POST">
    <input type="hidden" name="update" value="1">
    {{# csrf_token }}
        {{> csrf_token_input }}
    {{/ csrf_token }}

    <div class="tlp-pane">
        <div class="tlp-pane-container">
            <div class="tlp-pane-header">
                <h1 class="tlp-pane-title"><i class="fa fa-eye tlp-pane-title-icon"></i> {{ projects_visibility }}</h1>
            </div>
            <section class="tlp-pane-section">
                <div class="tlp-form-element">
                    <label class="tlp-label" for="toggle-project-admin-can-choose-visibility">
                        {{ projects_visibility_label }}
                    </label>
                    <div class="tlp-switch">
                        <input
                            type="checkbox"
                            name="project_admin_can_choose_visibility"
                            id="toggle-project-admin-can-choose-visibility"
                            class="tlp-switch-checkbox"
                            value="1"
                            {{# project_admin_can_choose }}checked{{/ project_admin_can_choose }}
                        >
                        <label for="toggle-project-admin-can-choose-visibility" class="tlp-switch-button" aria-hidden></label>
                    </div>
                    <p class="tlp-text-info">{{ projects_visibility_help }}</p>
                </div>
            </section>
        </div>
    </div>
